home *** CD-ROM | disk | FTP | other *** search
- /* Moniker 2.0.1 */
- /* Copyright ©1992 by Michael J. Simms */
- /* Modified 12/20/92 by Sean Hummel */
-
-
- /* Include the program header. */
- #include "Moniker 2.0.1.h"
- #include "AppleEvents.h"
-
- /* Function prototypes. */
- int main(void);
- static Boolean theKey(short k);
-
-
- /* Global variable. */
- Boolean gQuitDemand=FALSE;
- Boolean gNameManually = TRUE;
-
-
- main(void)
- /* The driver - head honcho. */
- {
- Boolean gotEvent,canRun;
- EventRecord event;
-
- /* Call initialization routine. */
- initialize();
-
- /* See if the program can run. */
- canRun=canRunProgram();
-
- /* If the program can run then do so. */
- if (canRun) {
- /* Install Apple Event handlers. */
- installAEHandlers();
-
- if (theKey(0x3A)) gNameManually = FALSE;
-
- /* Main loop. */
- do {
- if (gotEvent=WaitNextEvent(highLevelEventMask,&event,kSleep,NIL))
- AEProcessAppleEvent(&event);
- } while (!gQuitDemand);
-
- /* Remove Apple Event handlers. */
- removeAEHandlers();
- } else describeError(kCantRun);
- }
-
- static Boolean theKey(short k)
- {
- unsigned char km[16];
-
- GetKeys(km);
- return ((km[k>>3]>>(k&7)) & 1);
- }
-
-
-